# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=py3-vcrpy
pkgver=6.0.2
pkgrel=0
pkgdesc="Automatically mock your HTTP interactions to simplify and speed up testing"
options="!check" # Tests fail on the builders
url="https://github.com/kevin1024/vcrpy"
arch="noarch"
license="MIT"
depends="py3-yarl py3-yaml py3-wrapt"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-pytest-httpbin"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/v/vcrpy/vcrpy-$pkgver.tar.gz"
builddir="$srcdir/vcrpy-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	# ssl errors when test_requests.py is run
	.testenv/bin/python3 -m pytest --deselect=tests/integration/test_requests.py
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
c12920575b8b18227b62e7886c0ece341c985fa761135c1bdb9c3bf761b10256bd768fdec3c91ba3eaf982b15b8fea4424ac2b58612fedc54e36fc2beb1ec1cc  vcrpy-6.0.2.tar.gz
"
